<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%><!DOCTYPE HTML>
<%-- <%@include file="edit.jsp"%> --%>
<html>
<head>
<script type="text/javascript">
	$(function() {
		$('#enabled').radiobox({name:'entity.enabled',value:true,data:[[true,'有效'],[false,'无效']]});
		$('#isOpen').radiobox({name:'entity.isOpen',value:true,data:[[true,'开放'],[false,'不开放']]});
		$('#toolbar').toolbar({buttons:[
			{name:'save',iconCls:'icon-save',text:'保存'}
	  	],handler:handler});
		$('#rpid').combotreegrid({
	        url:'treeModel',
	        idField:'id',
	        treeField:'modelName',
	        width:'180',panelWidth:580,labelPosition:'top',
	        columns:[[
	        	{field:'modelName',title:'模块名称'},
				{field:'modelDes',title:'模块描述'},
				{field:'permCode',title:'权限编码'},
				{field:'permType',title:'权限类型'},
				{field:'permName',title:'权限名称'},
				{field:'level',title:'级别'},
				{field:'isOpen',title:'是否开放',formatter:$g.bv},
				{field:'enabled',title:'启用标记',formatter:$g.bv}
	        ]]
	    });
		//
		$('#resetRef').click(function(){
			$('#rpid').combotreegrid('clear')
		})
	});
	function handler() {
		switch(this.name) {
			case 'save': toSave();break;
		}
	}
	function toSave(){
		$.messager.progress({title:'系统提示',text:'数据处理中，请耐心等待...'});
		$.submit('#dataform',function(r) {
			$.messager.progress('close');
			if(r.code<0) return $alert(r.msg);
			top.$prompt('保存成功');
			top.$window.close(window,1,null);
		});
	}
</script>
</head>
<body>
	<div id="toolbar" class="toolbar" ></div>
	<div class="easyui-layout" data-options="fit:true">
		<div data-options="region:'center',border:false">
			<form id="dataform" action="add" method="post">
				<input type="hidden" value="${item.id }" name="entity.id"/>
				<table class="form-tbl">
					<tr class="form-tr">
						<th class="form-th">关联上级模块:</th>
						<td class="form-td">
							<input id="rpid" name="entity.pid" value="${item.pid }">
							<a href="#" id="resetRef">删除关联</a>
						</td>
					</tr>
					<tr class="form-tr">
						<th class="form-th">模块名称:</th>
						<td class="form-td">
							<input type="text" name="entity.modelName" value="${item.modelName }" class="form-text" style="width:170px;" />
						</td>
					</tr>
					<tr class="form-tr">
						<th class="form-th">模块描述:</th>
						<td class="form-td">
							<input type="text" name="entity.modelDes" value="${item.modelDes }" class="form-text" style="width:170px;" />
						</td>
					</tr>
					<tr class="form-tr">
						<th class="form-th">权限编码:</th>
						<td class="form-td">
							<input type="text" name="entity.permCode" value="${item.permCode }" class="form-text" style="width:170px;" />
						</td>
					</tr>
					<tr class="form-tr">
						<th class="form-th">权限类型:</th>
						<td class="form-td">
							<input type="text" name="entity.permType" value="${item.permType }" class="form-text" style="width:170px;" />
						</td>
					</tr>
					<tr class="form-tr">
						<th class="form-th">权限名称:</th>
						<td class="form-td">
							<input type="text" name="entity.permName" value="${item.permName }" class="form-text" style="width:170px;" />
						</td>
					</tr>
					<tr class="form-tr">
						<th class="form-th">级别（无效字段）:</th>
						<td class="form-td">
							<input type="text" name="entity.level" value="${item.level }" class="form-text" style="width:170px;" />
						</td>
					</tr>
					<tr class="form-tr">
						<th class="form-th">是否开放:</th>
						<td class="form-td">
							<div id="isOpen"></div>
						</td>
					</tr>
					<tr class="form-tr">
						<th class="form-th">是否启用:</th>
						<td class="form-td">
							<div id="enabled"></div>
						</td>
					</tr>
				</table>
			</form>
		</div>
	</div>
</body>
</html>